from Deque import Deque
'''
    回文检查：检查输入的字符串或者字符是否是首尾对称，如abcba
'''
def palchecker(palstring):
    q = Deque()   # 初始化双向队列,建立对象时一定要加（）

    # 字符串存入队列
    for ch in palstring:
        print(ch)
        q.addRear(ch)

    stillEqual = True
    # 判断
    while q.size() > 1 and stillEqual:
        if q.removeFront() != q.removeRear():
            stillEqual = False

    return stillEqual

if __name__ == '__main__':
    print(palchecker('racvar'))
